package com.ywk.pattern._8_methodfactory;

public interface IFactory {
    Operation CreateOperation();
}

class SubFactory implements IFactory {

    @Override
    public Operation CreateOperation() {
        return new OperationSubtract();
    }
}

class AddFactory implements IFactory {

    @Override
    public Operation CreateOperation() {
        return new OperationAdd();
    }
}

class MultiplyFactory implements IFactory {

    @Override
    public Operation CreateOperation() {
        return new OperationMultiply();
    }
}

class DivideFactory implements IFactory {

    @Override
    public Operation CreateOperation() {
        return new OperationDivide();
    }
}